class {
    onMount() {
        window.root = this;
    }
}

<container>
    <child key="child"/>
</container>
